package com.highspeed.bdk.gateway.socket.analyze.message.gui.resolver;

import com.highspeed.bdk.gateway.Util;
import com.highspeed.bdk.gateway.socket.analyze.message.gui.base.MessageResolver;

import java.util.Map;

/**
 * 3.12逻辑链路的端口对查询的反馈包
 * typedef struct _simplelink
 * {
 * U32 startPort; //16-bit rionet id + 16-bit portId
 * U32 endPort; //16-bit rionet id + 16-bit portId
 * } SimpleLink;
 */
public class SimpleLinkResolver extends MessageResolver {

    @Override
    protected Map doResolveBody(byte[] response) {
        short rionetId = Util.getShort(response, getOffset());
        offset2();
        logger.info("startPort  rionetId..........." + rionetId);

        short portId = Util.getShort(response, getOffset());
        offset2();
        logger.info("startPort  portId..........." + portId);

        rionetId = Util.getShort(response, getOffset());
        offset2();
        logger.info("endPort  rionetId..........." + rionetId);

        portId = Util.getShort(response, getOffset());
        offset2();
        logger.info("endPort  portId..........." + portId);
        return getContainer();
    }
}
